﻿#include "mainwindow.h"

#include <QApplication>
#include <QDir>
#include <QProcess>

#include <QSet>



int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QDir::setCurrent(a.applicationDirPath());

    //Map的key顺序
    QMap<QString, int> setTst;
    setTst.insert("aaa099.m3u8", 1);
    setTst.insert("aaa0111.m3u8", 1);
    setTst.insert("aaa100.m3u8", 1);
    setTst.insert("8", 1);
    setTst.insert("9", 1);
    setTst.insert("18", 1);

    QProcess process;
    QProcess processtl;
    processtl.start(QString("tasklist"));
    processtl.waitForFinished();
    QString strOutput = processtl.readAllStandardOutput();
    if(!strOutput.contains("aria2c.exe"))
    {
        QFileInfo program("aria2c.exe");
        if(!program.exists())
        {
            program.setFile("D:/Program Files/Aria2/aria2c.exe");
        }
        QStringList arguments;
        arguments << "--conf-path=aria2.conf";// << "--input-file=aria2.session" << "--save-session=aria2.session";
        process.setWorkingDirectory(program.absolutePath());
        process.start(program.absoluteFilePath(), arguments);
    }

    MainWindow w;
    w.show();

    a.exec();


    return 0;
}
